import functools
class Solution(object):
    @functools.cache
    def divisorGame(self, n):
        """
        :type n: int
        :rtype: bool
        """
        if n == 1:
            return False
        if not self.divisorGame(n - 1):
            return True
        for i in range(2, int(n ** 0.5) + 1):
            if n % i == 0:
                if not self.divisorGame(n - i):
                    return True
                if not self.divisorGame(n - (n // i)):
                    return True
        return False


data = Solution()
n = 3
print(data.divisorGame(n))